package com.ruoyi.web.controller.system;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.LuntaiPolicyRequestResult;
import com.ruoyi.system.service.ILuntaiPolicyRequestResultService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 保单申请延保审核结果记录
Controller
 * 
 * @author ruoyi
 * @date 2025-02-17
 */
@RestController
@RequestMapping("/system/requestResult")
public class LuntaiPolicyRequestResultController extends BaseController
{
    @Autowired
    private ILuntaiPolicyRequestResultService luntaiPolicyRequestResultService;

    /**
     * 查询保单申请延保审核结果记录列表
     */
    @PreAuthorize("@ss.hasPermi('system:result:list')")
    @GetMapping("/list")
    public TableDataInfo list(LuntaiPolicyRequestResult luntaiPolicyRequestResult)
    {
        startPage();
        List<LuntaiPolicyRequestResult> list = luntaiPolicyRequestResultService.selectLuntaiPolicyRequestResultList(luntaiPolicyRequestResult);
        return getDataTable(list);
    }

    /**
     * 导出保单申请延保审核结果记录列表
     */
    @PreAuthorize("@ss.hasPermi('system:result:export')")
    @Log(title = "保单申请延保审核结果记录 ", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, LuntaiPolicyRequestResult luntaiPolicyRequestResult)
    {
        List<LuntaiPolicyRequestResult> list = luntaiPolicyRequestResultService.selectLuntaiPolicyRequestResultList(luntaiPolicyRequestResult);
        ExcelUtil<LuntaiPolicyRequestResult> util = new ExcelUtil<LuntaiPolicyRequestResult>(LuntaiPolicyRequestResult.class);
        util.exportExcel(response, list, "保单申请延保审核结果记录 数据");
    }

    /**
     * 获取保单申请延保审核结果记录
详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:result:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return success(luntaiPolicyRequestResultService.selectLuntaiPolicyRequestResultById(id));
    }

    /**
     * 新增保单申请延保审核结果记录

     */
    @PreAuthorize("@ss.hasPermi('system:result:add')")
    @Log(title = "保单申请延保审核结果记录 ", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody LuntaiPolicyRequestResult luntaiPolicyRequestResult)
    {
        return toAjax(luntaiPolicyRequestResultService.insertLuntaiPolicyRequestResult(luntaiPolicyRequestResult));
    }

    /**
     * 修改保单申请延保审核结果记录

     */
    @PreAuthorize("@ss.hasPermi('system:result:edit')")
    @Log(title = "保单申请延保审核结果记录 ", businessType = BusinessType.UPDATE)
    @PutMapping("/edit")
    public AjaxResult edit(@RequestBody LuntaiPolicyRequestResult luntaiPolicyRequestResult)
    {
        return toAjax(luntaiPolicyRequestResultService.updateLuntaiPolicyRequestResult(luntaiPolicyRequestResult));
    }

    /**
     * 删除保单申请延保审核结果记录

     */
    @PreAuthorize("@ss.hasPermi('system:result:remove')")
    @Log(title = "保单申请延保审核结果记录 ", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Integer[] ids)
    {
        return toAjax(luntaiPolicyRequestResultService.deleteLuntaiPolicyRequestResultByIds(ids));
    }
}
